{% extends "master.html" %}
{% block subtitle %} - 系统设置 - 创建用户{% endblock %}

{% block extJS %}
<script language="JavaScript" type="text/javascript">
//<![CDATA[
    function save(){
        $("form").submit();
    }
    
    function toCancel(){
         redirect_alert("{{MSG_LEAVE_WITHOUT_SAVING}}","{{url_for('bpSys.view',action='obj_index',t='USR')}}");
    }
    
//]]>
</script>
{% endblock %}

{% block main %}
<div class="container">
    <div class="row">
        <ol class="breadcrumb">
          <li><a href="{{url_for('bpSys.view')}}">系统设置</a></li>
          <li><a href="{{url_for('bpSys.view',action='obj_index',t='USR')}}">用户管理</a></li>
          <li class="active">创建用户</li>
        </ol>
    </div>
    <div class="row">
        <div class="btn-toolbar pull-right">
            <div class="btn-group"><button class="btn btn-primary" onclick="save()">{{BTN_SUBMIT}}</button></div>
            <div class="btn-group"><button class="btn btn-inverse" onclick="toCancel()">{{BTN_CANCEL}}</button></div>
        </div>
    </div>

    <div class="row">
        <form class="form-horizontal" method='POST' action="{{url_for('.view',action='obj_save')}}">
            <input type="hidden" name="t" value="{{t}}"/>
            <div class="control-group">
                <label class="control-label" for="name">用户名<span style='color:red'>*</span></label>
                <div class="controls">
                  <input type="text" id="name" name="name" placeholder="用户名">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="email">电子邮箱</label>
                <div class="controls">
                  <input type="text" id="email" name="email" placeholder="电子邮箱">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="password">密码<span style='color:red'>*</span></label>
                <div class="controls">
                  <input type="password" id="password" name="password" placeholder="密码">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="repassword">确认密码<span style='color:red'>*</span></label>
                <div class="controls">
                  <input type="password" id="repassword" name="repassword" placeholder="确认密码">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="phone">联系电话</label>
                <div class="controls">
                  <input type="text" id="phone" name="phone" placeholder="联系电话">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="mobile">移动电话</label>
                <div class="controls">
                  <input type="text" id="mobile" name="mobile" placeholder="移动电话">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="groupID">所属组别</label>
                <div class="controls">
                  <select class="" id="groupID" name="groupID">
                      {% for g in groups %}
                        <option value="{{g.id}}">{{g}}</option>
                      {% endfor %}
                  </select>
                </div>
            </div>
        </form>
    </div>
</div>
{% endblock %}